package correct.day18;

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        char[] arr = scanner.next().toCharArray();
        StringBuffer str = new StringBuffer();
        int len = arr.length;
        for(int i = 0; i < len - 1; i++) {
            str.append(arr[i]);
            int count = 1;
            while(i < len - 1 && arr[i] == arr[i+1]) {
                count++;
                i++;
            }
            if(count > 1) {
                str.append(count);
            }
        }

        System.out.println(str);
    }
}
